using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._RasterProperties
{
    /// <summary>
    /// <para>Build Pyramids</para>
    /// <para>Builds raster pyramids for your raster dataset.</para>
    /// <para>为栅格数据集构建栅格金字塔。</para>
    /// </summary>    
    [DisplayName("Build Pyramids")]
    public class BuildPyramids : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public BuildPyramids()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster_dataset">
        /// <para>Input Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The raster dataset for which you want to build pyramids.</para>
        ///   <para>The input should have more than 1,024 rows and 1,024 columns.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要为其构建金字塔的栅格数据集。</para>
        ///   <para>输入应包含超过 1,024 行和 1,024 列。</para>
        /// </xdoc></para>
        /// </param>
        public BuildPyramids(object _in_raster_dataset)
        {
            this._in_raster_dataset = _in_raster_dataset;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Build Pyramids";

        public override string CallName => "management.BuildPyramids";

        public override List<string> AcceptEnvironments => ["parallelProcessingFactor", "pyramid", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_raster_dataset, _pyramid_level, _SKIP_FIRST.GetGPValue(), _resample_technique.GetGPValue(), _compression_type.GetGPValue(), _compression_quality, _skip_existing.GetGPValue(), _out_raster];

        /// <summary>
        /// <para>Input Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The raster dataset for which you want to build pyramids.</para>
        ///   <para>The input should have more than 1,024 rows and 1,024 columns.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要为其构建金字塔的栅格数据集。</para>
        ///   <para>输入应包含超过 1,024 行和 1,024 列。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster_dataset { get; set; }


        /// <summary>
        /// <para>Pyramid levels</para>
        /// <para><xdoc>
        ///   <para>Choose the number of reduced-resolution dataset layers that will be built. The default value is -1, which will build full pyramids. A value of 0 will result in no pyramid levels.</para>
        ///   <para>To delete pyramids, set the number of levels to 0.</para>
        ///   <para>The maximum number of pyramid levels you can specify is 29. Any value that is 30 or higher will revert to a value of -1, which will create a full set of pyramids.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择将要构建的低分辨率数据集图层的数量。默认值为 -1，将构建完整的金字塔。值为 0 将导致没有金字塔级别。</para>
        ///   <para>要删除金字塔，请将级别数设置为 0。</para>
        ///   <para>您可以指定的最大金字塔级别数为 29。任何 30 或更高的值都将恢复为 -1 的值，这将创建一整套金字塔。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Pyramid levels")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _pyramid_level { get; set; } = null;


        /// <summary>
        /// <para>Skip first level</para>
        /// <para><xdoc>
        ///   <para>Choose whether to skip the first pyramid level. Skipping the first level will take up slightly less disk space, but it will slow down performance at these scales.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The first pyramid level will be built. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—The first pyramid level will not be built.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>选择是否跳过第一个金字塔级别。跳过第一级将占用稍少的磁盘空间，但会降低这些规模的性能。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 将构建第一个金字塔级别。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 不会构建第一个金字塔级别。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip first level")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _SKIP_FIRST_value _SKIP_FIRST { get; set; } = _SKIP_FIRST_value._false;

        public enum _SKIP_FIRST_value
        {
            /// <summary>
            /// <para>SKIP_FIRST</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SKIP_FIRST")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NONE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NONE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Pyramid resampling technique</para>
        /// <para><xdoc>
        ///   <para>The resampling technique used to build your pyramids.</para>
        ///   <bulletList>
        ///     <bullet_item>Nearest—This method uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bilinear—This method determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.</bullet_item><para/>
        ///     <bullet_item>Cubic—This method determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于构建金字塔的重采样技术。</para>
        ///   <bulletList>
        ///     <bullet_item>最近 - 此方法在重采样时使用最近像元的值为输出像元分配值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>双线性 - 此方法根据四个最近输入像元中心的加权距离平均值确定像元的新值。</bullet_item><para/>
        ///     <bullet_item>立方体 （Cubic） - 此方法基于通过 16 个最近的输入像元中心拟合平滑曲线来确定像元的新值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Pyramid resampling technique")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _resample_technique_value _resample_technique { get; set; } = _resample_technique_value._NEAREST;

        public enum _resample_technique_value
        {
            /// <summary>
            /// <para>Nearest</para>
            /// <para>Nearest—This method uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.</para>
            /// <para>最近 - 此方法在重采样时使用最近像元的值为输出像元分配值。这是默认设置。</para>
            /// </summary>
            [Description("Nearest")]
            [GPEnumValue("NEAREST")]
            _NEAREST,

            /// <summary>
            /// <para>Bilinear</para>
            /// <para>Bilinear—This method determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.</para>
            /// <para>双线性 - 此方法根据四个最近输入像元中心的加权距离平均值确定像元的新值。</para>
            /// </summary>
            [Description("Bilinear")]
            [GPEnumValue("BILINEAR")]
            _BILINEAR,

            /// <summary>
            /// <para>Cubic</para>
            /// <para>Cubic—This method determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.</para>
            /// <para>立方体 （Cubic） - 此方法基于通过 16 个最近的输入像元中心拟合平滑曲线来确定像元的新值。</para>
            /// </summary>
            [Description("Cubic")]
            [GPEnumValue("CUBIC")]
            _CUBIC,

        }

        /// <summary>
        /// <para>Pyramid compression type</para>
        /// <para><xdoc>
        ///   <para>The compression type to use when building the raster pyramids.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—If the source data is compressed using a wavelet compression, it will build pyramids with the JPEG compression type; otherwise, LZ77 will be used. This is the default compression method.</bullet_item><para/>
        ///     <bullet_item>LZ77—The LZ77 compression algorithm will be used to build the pyramids. LZ77 can be used for any data type.</bullet_item><para/>
        ///     <bullet_item>Jpeg—The JPEG compression algorithm will be used to build pyramids. Only data that adheres to the JPEG compression specification can use this compression type. If JPEG is chosen, you can then set the compression quality.</bullet_item><para/>
        ///     <bullet_item>Jpeg Luma and Chroma—A lossy compression using the luma (Y) and chroma (Cb and Cr) color space components will be used to build pyramids.</bullet_item><para/>
        ///     <bullet_item>No compression—No compression will be used when building pyramids.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>构建栅格金字塔时要使用的压缩类型。</para>
        ///   <bulletList>
        ///     <bullet_item>默认 - 如果使用小波压缩对源数据进行压缩，则将构建具有 JPEG 压缩类型的金字塔;否则，将使用 LZ77。这是默认的压缩方法。</bullet_item><para/>
        ///     <bullet_item>LZ77—LZ77 压缩算法将用于构建金字塔。LZ77 可用于任何数据类型。</bullet_item><para/>
        ///     <bullet_item>Jpeg—JPEG 压缩算法将用于构建金字塔。只有符合 JPEG 压缩规范的数据才能使用此压缩类型。如果选择了 JPEG，则可以设置压缩质量。</bullet_item><para/>
        ///     <bullet_item>Jpeg Luma 和 Chroma - 使用亮度 （Y） 和色度（Cb 和 Cr）色彩空间分量的有损压缩将用于构建金字塔。</bullet_item><para/>
        ///     <bullet_item>无压缩—构建金字塔时不使用压缩。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Pyramid compression type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compression_type_value _compression_type { get; set; } = _compression_type_value._DEFAULT;

        public enum _compression_type_value
        {
            /// <summary>
            /// <para>Default</para>
            /// <para>Default—If the source data is compressed using a wavelet compression, it will build pyramids with the JPEG compression type; otherwise, LZ77 will be used. This is the default compression method.</para>
            /// <para>默认 - 如果使用小波压缩对源数据进行压缩，则将构建具有 JPEG 压缩类型的金字塔;否则，将使用 LZ77。这是默认的压缩方法。</para>
            /// </summary>
            [Description("Default")]
            [GPEnumValue("DEFAULT")]
            _DEFAULT,

            /// <summary>
            /// <para>Jpeg</para>
            /// <para>Jpeg—The JPEG compression algorithm will be used to build pyramids. Only data that adheres to the JPEG compression specification can use this compression type. If JPEG is chosen, you can then set the compression quality.</para>
            /// <para>Jpeg—JPEG 压缩算法将用于构建金字塔。只有符合 JPEG 压缩规范的数据才能使用此压缩类型。如果选择了 JPEG，则可以设置压缩质量。</para>
            /// </summary>
            [Description("Jpeg")]
            [GPEnumValue("JPEG")]
            _JPEG,

            /// <summary>
            /// <para>LZ77</para>
            /// <para>LZ77—The LZ77 compression algorithm will be used to build the pyramids. LZ77 can be used for any data type.</para>
            /// <para>LZ77—LZ77 压缩算法将用于构建金字塔。LZ77 可用于任何数据类型。</para>
            /// </summary>
            [Description("LZ77")]
            [GPEnumValue("LZ77")]
            _LZ77,

            /// <summary>
            /// <para>No compression</para>
            /// <para>No compression—No compression will be used when building pyramids.</para>
            /// <para>无压缩—构建金字塔时不使用压缩。</para>
            /// </summary>
            [Description("No compression")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Jpeg Luma and Chroma</para>
            /// <para>Jpeg Luma and Chroma—A lossy compression using the luma (Y) and chroma (Cb and Cr) color space components will be used to build pyramids.</para>
            /// <para>Jpeg Luma 和 Chroma - 使用亮度 （Y） 和色度（Cb 和 Cr）色彩空间分量的有损压缩将用于构建金字塔。</para>
            /// </summary>
            [Description("Jpeg Luma and Chroma")]
            [GPEnumValue("JPEG_YCbCr")]
            _JPEG_YCbCr,

        }

        /// <summary>
        /// <para>Compression quality (1-100)</para>
        /// <para>The compression quality to use when pyramids are built with the JPEG compression method. The value must be between 0 and 100. The values closer to 100 will produce a higher-quality image, but the compression ratio will be lower.</para>
        /// <para>使用 JPEG 压缩方法构建金字塔时要使用的压缩质量。该值必须介于 0 和 100 之间。接近 100 的值将产生更高质量的图像，但压缩比会更低。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression quality (1-100)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _compression_quality { get; set; } = 75;


        /// <summary>
        /// <para>Skip Existing</para>
        /// <para><xdoc>
        ///   <para>Specify whether to build pyramids only when they are missing or regenerate them even if they exist.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Pyramids will be built even if they already exist; therefore, existing pyramids will be overwritten. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Pyramids will only be built if they do not already exist.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是仅在金字塔缺失时才构建金字塔，还是即使金字塔存在也重新生成金字塔。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 即使金字塔已经存在，也会建造金字塔;因此，现有的金字塔将被覆盖。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 仅当金字塔尚不存在时，才会构建金字塔。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip Existing")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _skip_existing_value _skip_existing { get; set; } = _skip_existing_value._false;

        public enum _skip_existing_value
        {
            /// <summary>
            /// <para>SKIP_EXISTING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SKIP_EXISTING")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>OVERWRITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OVERWRITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_raster { get; set; }


        public BuildPyramids SetEnv(object parallelProcessingFactor = null, object pyramid = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}